import Component.*;
import Decorator.*;

public class Main {
    public static void main(String[] args) {

        Component textBox1 = new TextComponents();

        Decorator decorator1 = new DecoratorUnderline(new DecoratorBold(new DecoratorItalic(textBox1))) ;
        decorator1.operation("这是第一段文字");
        System.out.println("----------------------");

        Component textBox2 = new TextComponents();
        Decorator decorator2=new DecoratorUnderline(textBox2);
        decorator2.operation("这是第二段文字");
        System.out.println("----------------------");

        Component textBox3 = new TextComponents();
        Decorator decorator3=new DecoratorUnderline(textBox2);
        Decorator decorator4=new DecoratorItalic(decorator3);
        Decorator decorator5=new DecoratorBold(decorator4);
        decorator5.operation("这是第三段文字");


    }
}